#include <iostream>
#include <memory>
#include <string>
#include <jsoncpp/json/json.h>

int main()
{
    Json::Value root_write;
    root_write["name"] = "Wang";
    root_write["age"] = "18";
    root_write["city"] = "Shandong";

    Json::FastWriter writer;
    std::string info = writer.write(root_write);
    
    Json::Value root_read;
    Json::Reader reader;
    reader.parse(info, root_read);
    std::string name = root_read["name"].asString();
    std::string age = root_read["age"].asString();
    std::string city = root_read["city"].asString();

    std::cout << name << std::endl;
    std::cout << age << std::endl;
    std::cout << city << std::endl;
    return 0;
}